package org.micode.demo.db.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.micode.demo.db.dao.SysDictionaryDao;
import org.micode.demo.db.domain.dto.SysDictionaryDTO;
import org.micode.demo.db.domain.entity.SysDictionaryDO;
import org.micode.demo.db.domain.query.SysDictionaryQuery;
import org.micode.demo.db.service.DaoSysDictionaryService;
import org.micode.demo.db.vo.IdNameVO;
import org.micode.libs.dao.base.BaseAllServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 字典配置信息(sys_dictionary) 服务实现类
 * <p>
 *
 * @author: wutianbin
 * @version: v1.0.24
 * @CreateDate: 2021-09-06
 */
@Service
@Slf4j
public class DaoSysDictionaryServiceImpl
        extends BaseAllServiceImpl<Long, SysDictionaryDTO, SysDictionaryDO, SysDictionaryQuery, SysDictionaryDao>
        implements DaoSysDictionaryService {

    @Autowired
    private SysDictionaryDao sysDictionaryDao;

    @Override
    protected SysDictionaryDao getMyDao() {
        return sysDictionaryDao;
    }

    @Override
    public List<IdNameVO> listIdName(String paramType) {
        return sysDictionaryDao.listIdNameByType(paramType);
    }

    @Override
    public List<SysDictionaryDTO> listByParamType(String paramType) {
        return sysDictionaryDao.listByParamType(paramType);
    }

    @Override
    public List<SysDictionaryDTO> loadAllList() {
        return sysDictionaryDao.listByParamType(null);
    }

}
